package com.hw.esay.myExam;

import java.util.Scanner;
//不要三句号的歪
/**
 * 对于给定的数列，你需要直接求解出省略了多少数字。
 */
public class HJ54 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()){
            String str = scan.nextLine();
            char[] chars = str.toCharArray();
            long cha = chars[2] - chars[0];
            long last = Long.parseLong(String.valueOf(str.substring(8)));
            long second = Long.parseLong(String.valueOf(str.substring(2,3)));
            long num = (last-second)/cha;
            System.out.println(num-1);
        }

    }
}
